import type { PatientItem, PatientParams } from "@/types/patient"
import { request } from "@/utils/http"

// 1. 获取患者列表数组
export const getPatientListApi = () => {
  return request.get<null, PatientItem[]>('/patient/mylist')
}

// 2. 删除患者（家庭档案）
export const removePatientApi = (id: string) => {
  return request.delete(`/patient/del/${id}`)
}

// 3.添加患者
export const addPatientApi = (data: PatientParams) => {
  return request.post<null, { id: string }>('/patient/add', data)
}

// 4.患者详情（家庭档案）
export const patientDetailApi = (id: string) => {
  return request.get<null, PatientParams>(`/patient/info/${id}`)
}

// 5.编辑(更新)患者（家庭档案）
export const updatePatientApi =(data:PatientParams)=>{
  return request.put(`/patient/update`, data)
}